<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\UserController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::prefix('')->group(function () {

    Route::post('enter', [LoginController::class, 'enter']);
    Route::get('promot/product', [LoginController::class, 'product']);
    Route::get('promot/banners', [LoginController::class, 'banners']);
    Route::get('promot/about', [LoginController::class, 'about']);

    Route::post('login', [LoginController::class, 'login']);
    Route::get('check', [LoginController::class, 'check']);

    Route::get('banners', [IndexController::class, 'banners']);
    Route::get('category', [IndexController::class, 'category']);
    Route::get('product', [IndexController::class, 'product']);
    Route::get('kefu', [IndexController::class, 'kefu']);
    Route::get('aboutUs', [IndexController::class, 'aboutUs']);

    Route::middleware('auth:sanctum')->group(function () {
        Route::post('upload', [UserController::class, 'upload']);

        Route::get('logout', [UserController::class, 'logout']);

        Route::post('like', [UserController::class, 'like']);
        Route::get('info', [UserController::class, 'info']);
        Route::post('feedback', [UserController::class, 'feedback']);
        Route::post('update', [UserController::class, 'update']);
        Route::post('update', [UserController::class, 'update']);
        Route::get('logoff', [UserController::class, 'logoff']);
        Route::get('likeList', [UserController::class, 'likeList']);
        Route::get('inviteList', [UserController::class, 'inviteList']);
        Route::get('inviteCode', [UserController::class, 'inviteCode']);
        Route::post('bind', [UserController::class, 'bind']);

        Route::post('card', [UserController::class, 'card']);
        Route::post('withdraw', [UserController::class, 'withdraw']);
        Route::get('withdrawList', [UserController::class, 'withdrawList']);
        Route::get('reward', [UserController::class, 'reward']);

        Route::post('sms', [LoginController::class, 'sms']);

    });
});
